﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Practice.DTO
{
    /*
     * DTO：数据传输对象（前台和服务器相互之间的数据传输）
     * 
     * 1、可以过滤敏感信息
     * 2、过滤一些不必要的信息
     * **/
    /// <summary>
    /// 产品的SPU
    /// </summary>
    public class ProductInputDTO
    {
        public Guid BrandId { get; set; }
        public Guid CategoyrId { get; set; }
        public string? Cover { get; set; }
        public string? Description { get; set; }
        public string Name { get; set; }

        //一个spu对应的多个sku
        public List<ProductSKUInputDTO> Skus { get; set; }

        //一个spu对应的多个规格
        public List<ProductSpecInputDTO> Specs { get; set; }
    }

    /// <summary>
    /// spu对应的sku
    /// </summary>
    public class ProductSKUInputDTO
    {
        public decimal InPrice { get; set; }
        public decimal MarketPrice { get; set; }
        public decimal SalePrice { get; set; }
        public string Spec { get; set; } //json格式的数据
        public int Stock { get; set; }
        //一个sku对应的多张图片
        public List<string> Images { get; set; }
    }

    /// <summary>
    /// spu规格应对的规格值
    /// </summary>
    public class ProductSpecInputDTO 
    {
        public string SpecName { get; set; }

        public List<string> SpecValues { get; set; }
    }

}
